package com.cqemme.activitiservice.feign.fallback;

import com.cqemme.activitiservice.feign.SchoolServiceFeign;
import com.cqemme.comm.po.ConnectTimeoutResult;
import com.cqemme.comm.po.Result;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author amkj
 */
@Component
@Slf4j
public class SchoolServiceFeignFallbackFactory implements FallbackFactory<SchoolServiceFeign> {
    @Override
    public SchoolServiceFeign create(Throwable throwable) {
        return new SchoolServiceFeign() {
            @Override
            public Result queryAllByEnumType(String studentId) {
                return null;
            }

            @Override
            public String queryByDeviceNumber(String deviceNumber) {
                return ConnectTimeoutResult.timeoutResultString(throwable);
            }

            @Override
            public String queryCriAndOrgByOrgCode(String orgCode, Integer type) {
                return ConnectTimeoutResult.timeoutResultString(throwable);
            }

            @Override
            public String getStudentExtByStudentIdCardNo(String idCardNo) {
                return ConnectTimeoutResult.timeoutResultString(throwable);
            }

        };
    }
}
